<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <!-- 开发环境版本，包含了用帮助的命令行警告 -->
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
  <div id="d1">
    <h1>{{msg}}</h1>
    <!--1. 访问修饰键-->
    <input type="text" @keyUp.enter="showMessage" placeholder="按下了回车键！"> <br>
    <!--2. 组合键的使用-->
    <input type="text" @keyup.alt.c="say" placeholder="按下了alt + c组合键！"> <br>
  </div>
</body>
</html>
<script>
  new Vue({
    el:'#d1',
    data:{
      msg : ''
    },
    methods:{
      showMessage(){
        this.msg = '大家好！'
      },
      say(){
        console.log('你按下了alt + c')
      }
    }
  })
</script>
